<?php
require_once('themes/head.php');
require_once('controller/cetakdetilstrukController.php');
while(ob_get_level())
ob_end_clean();
header("Content-Encoding: None",true);
//print_r($daftar_detail);
//$id=$_GET['detail'];

$judul = "STRUK DETIL PEMBELIAN";
$thanks ="terima kasih telah berbelanja";
$header = array(
	array("label"=>"tgl_beli", "length"=>50, "align"=>"L"),
	array("label"=>"jml_jns_bar", "length"=>30, "align"=>"L"),
	array("label"=>"total_bayar", "length"=>30, "align"=>"L")
	);
 
#sertakan library FPDF dan bentuk objek
require ('fpdf16/fpdf16.php');
$pdf = new FPDF();
$pdf->AddPage();
 
#tampilkan judul laporan
$pdf->SetFont('Arial','B','16');
$pdf->Cell(0,20, $judul, '0', 1, 'C');
 
#buat header tabel
$pdf->SetFont('Arial','','10');
$pdf->SetFillColor(255,0,0);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(128,0,0);
foreach ($header as $kolom) {
	$pdf->Cell($kolom['length'], 5, $kolom['label'], 1, '0', $kolom['align'], true);
}
$pdf->Ln();
 
#tampilkan data tabelnya
$pdf->SetFillColor(224,235,255);
$pdf->SetTextColor(0);
$pdf->SetFont('');
$fill=false;
foreach($daftar_detail as $detail){
	$pdf->Cell(50,5,$detail['nama_produk'],1,'0', 'C');
	$pdf->Cell(30,5,$detail['nama'],1,'0', 'C');
	$pdf->Cell(30,5,$detail['harga'],1,'0', 'C');
	$pdf->Ln();
	
	
} 

#tampilkan tanda terima kasih
$pdf->SetFont('Arial','B','16');
$pdf->Cell(0,20, $thanks, '0', 0, 'C');

#output file PDF
$pdf->Output();




/**require('fpdf16/fpdf16.php');
$pdf=new FPDF();
$pdf->addPage();
$pdf->SetFont('Arial','','10');
$pdf->Cell(0,20, $judul, '0', 1, 'C');
$pdf->Output()	*/
	

?>